package com.cn.wanxi.servlet.pageDataFindAll;

import com.alibaba.fastjson.JSONObject;
import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.service.ICompanyService;
import com.cn.wanxi.service.impl.CompanyServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/contactus")
public class contactusServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //          获得公司信息
        ICompanyService companyService=new CompanyServiceImpl();
        CompanyModel companyModel=companyService.findAll();

        JSONObject jsonObject=new JSONObject();
        jsonObject.put("companyModel",companyModel);
        resp.getWriter().println(jsonObject);
    }
}
